# Maintainer: Felix Yan <felixonmars@archlinux.org>

pkgname=python-pyhamcrest
pkgver=2.0.4
_commit=89658b01ae5e6e6be4ebd7d77c80eed1de46bd5c
pkgrel=3
pkgdesc="Hamcrest framework for matcher objects"
arch=('any')
license=('BSD')
url="https://github.com/hamcrest/PyHamcrest"
depends=('python')
makedepends=('git' 'python-build' 'python-installer' 'python-hatchling' 'python-hatch-vcs')
checkdepends=('python-pytest')
source=("git+https://github.com/hamcrest/PyHamcrest.git#commit=$_commit")
sha512sums=('SKIP')

build() {
  cd PyHamcrest
  python -m build -nw
}

check() {
  cd PyHamcrest
  PYTHONPATH="$PWD/src" pytest
}

package() {
  cd PyHamcrest
  python -m installer -d "$pkgdir" dist/*.whl
  install -Dm644 LICENSE.txt -t "$pkgdir"/usr/share/licenses/$pkgname/
}
